@include('../top')
<!--banner-->
<div class="banner-top">
	<div class="container">
		<h1>Register</h1>
		<em></em>
		<h2><a href="index.html">Home</a><label>/</label>Register</a></h2>
	</div>
</div>
<!--login-->
<div class="container">
		<div class="login">
			<form method='post' action="" id='f'>
				{!! csrf_field() !!}
			<div class="col-md-6 login-do">
			<div class="login-mail">
					<input type="text" placeholder="用户名" required="" name='name' value="{{old('name')}}">
					<i  class="glyphicon glyphicon-user"></i>
					
				</div>
				@if ($errors->has('name'))
					<p style="display: block; background:green;" id="amountError" class="hvr-skew-backward">{{$errors->first('name')}}</p>
					@endif
				<div class="login-mail">
					<input type="text" placeholder="手机号" required="" name='mobile' id='mobile' value="{{old('mobile')}}">
					<i  class="glyphicon glyphicon-phone"></i>
				</div>
				@if ($errors->has('mobile'))
					<p style="display: block; background:green" id="amountError" class="hvr-skew-backward">{{$errors->first('mobile')}}</p>
					@endif
				<div class="login-mail">
					<input type="text" placeholder="邮箱地址" required="" name='email' value="{{old('email')}}">
					<i  class="glyphicon glyphicon-envelope"></i>
				</div>
				@if ($errors->has('email'))
					<p style="display: block; background:green" id="amountError" class="hvr-skew-backward">{{$errors->first('email')}}</p>
					@endif
				<div class="login-mail">
					<input type="password" placeholder="请输入密码" required="" name='password' value="{{old('password')}}">
					<i class="glyphicon glyphicon-lock"></i>
				</div>
				@if ($errors->has('password'))
					<p style="display: block; background:green" id="amountError" class="hvr-skew-backward">{{$errors->first('password')}}</p>
					@endif

					<div class="login-mail">
               
                <input name="verify" id="amountError" placeholder="Msg Verify" type="text">
                
            </div>
				   <!-- <a class="news-letter " href="#">
						 <label class="checkbox1"><input type="checkbox" name="checkbox" ><i> </i>Forget Password</label>
					   </a> -->

					<input type="button" value="获取验证码" style="margin-left:20px; margin-top:3px" class="hvr-skew-backward" class="pull-left" id='msgb'>

                <button  style="margin-left:200px; margin-top:3px" class="hvr-skew-backward" class="pull-left">
                	<input type="submit" value="注册">
                </button>


			</div>
			<div class="col-md-6 login-right">
				 <h3>Completely Free Account</h3>
				 
				 <p>Pellentesque neque leo, dictum sit amet accumsan non, dignissim ac mauris. Mauris rhoncus, lectus tincidunt tempus aliquam, odio 
				 libero tincidunt metus, sed euismod elit enim ut mi. Nulla porttitor et dolor sed condimentum. Praesent porttitor lorem dui, in pulvinar enim rhoncus vitae. Curabitur tincidunt, turpis ac lobortis hendrerit, ex elit vestibulum est, at faucibus erat ligula non neque.</p>
				<a href="login.html" style="margin-left:400px" class="hvr-skew-backward">Login</a>

			</div>
			
			<div class="clearfix"> </div>
			</form>
		</div>

</div>

<!--//login-->

		<!--brand-->
		<div class="container">
			<div class="brand">
				<div class="col-md-3 brand-grid">
					<img src="/images/ic.png" class="img-responsive" alt="">
				</div>
				<div class="col-md-3 brand-grid">
					<img src="/images/ic1.png" class="img-responsive" alt="">
				</div>
				<div class="col-md-3 brand-grid">
					<img src="/images/ic2.png" class="img-responsive" alt="">
				</div>
				<div class="col-md-3 brand-grid">
					<img src="/images/ic3.png" class="img-responsive" alt="">
				</div>
				<div class="clearfix"></div>
			</div>
			</div>
			<!--//brand-->
			</div>
			
		</div>
	<!--//content-->
		<!--//footer-->
@include('../bottom')
		<!--//footer-->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

	<script src="/js/simpleCart.min.js"> </script>
<!-- slide -->
<script src="/js/bootstrap.min.js"></script>

<script>
	$('#f').submit(function(){
		var patt;
		patt=/^1[3578]\d{9}$/
		if(!patt.test($('#mobile').val())){
			alert('手机号不正确');
			return false;
		}
			var smcode;
		$.ajax('/home/checksm',{
			'async':false,
			'success':function(msg){
				smcode=msg;
			}

});
		if(smcode!=$('#amountError').val()){
			alert('验证码错误');
			return false;
		}
		// return false;
});


	$('#msgb').click(function(){
		var mobile=$('#mobile').val();

		if(!/^1[3578]\d{9}$/.test(mobile)){
			alert('手机号不正确');
			return false;
		}

		$.get('/home/sm/'+mobile,function(msg){
			// console.log(msg);

		},'json');
		return false;
	});
</script>
 
</body>
</html>